package com.sky.controller;

import com.sky.service.OmsOrderReturnApplyService;
import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * 退款申请
 */
@RestController
@RequestMapping("/orderReturnApply")
public class OrderReturnApplyController {

    @Resource
    private OmsOrderReturnApplyService orderReturnApplyService;

    @Resource
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/list")
    public Object test() throws InterruptedException {
        return orderReturnApplyService.test();
    }

    @RequestMapping("/sendMqMessage")
    public String sendMqMessage() {
        // https://skymall.com/api/sky-mall-order/orderReturnApply/sendMqMessage
        rabbitTemplate.convertAndSend("order.event.exchange", "order.create.order", "hello world");
        return "mq消息发送成功！";
    }
}
